package net.martinimix.dao.account;

import net.martinimix.beans.support.PrototypeBeanFactory;
import net.martinimix.domain.account.Customer;

/**
 * Provides a factory to create customer beans from a prototype
 * in the application context.
 * 
 * @author Scott Rossillo
 *
 */
public class PrototypeAccountFactory extends PrototypeBeanFactory {

	private final static String CUSTOMER_BEAN = "customer";

	/**
	 * Creates a new prototype aware customer data access object.
	 */
	protected PrototypeAccountFactory() {
		super();
		super.addPrototype(CUSTOMER_BEAN, Customer.class);
	}
	
	/**
	 * Returns a new customer bean based on the customer prototype in
	 * the application context.
	 * 
	 * @return a new <code>Customer</code>
	 */
	protected final Customer createCustomerBean() {
		return (Customer) super.createBean(CUSTOMER_BEAN);
	}
}
